#!/usr/bin/env python
'readTextFile.py --read and display text file'
import os
#get filename
fname = raw_input('Enter filename : ')
print

#attempt to open file for reading
if os.path.exists(fname) :
    try:
        fobj = open(fname,'r')
    except IOError , e:
        print '*** file open error: ' , e
    else:
        #display contents to the screen
        for line in fobj:
            print line,
        fobj.close()
else:
    print 'ERROR: %s is not exists!' % fname
    
